///////////////////////////////////////////////////////////////////////////////
// Project: Hoyo Client Game
//
// hy_copy_logic.h
// Created: 2013-7-15
// Author: Like Cheng
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include "hy_includes.h"

class hy_copy_data;
typedef std::map< int, hy_copy_data* > hy_copy_data_map;
class hy_copy_logic : public hy_object
{
public:
	hy_copy_logic();
	virtual ~hy_copy_logic();

	static hy_copy_logic*		instance();
	static void					purge_instance();
public:
	//bool						create_copy( int player_id );
	//int							get_copy_id( int level, int battle_value );


	void						proc_going_copy( void* );
	void						proc_start_copy( void* );
	void						proc_battle_complate_operator( void* );

	bool						proc_battle_complate_by_battle( int battle_id );
	void						next_level_copy( int player_id, int copy_id );
	void						return_copy_result( int player_id, int copy_id );
public:
	hy_copy_data_map&			get_copy_data_map(){ return m_copy_data_map; }
	hy_copy_data*				get_copy_data_by_id( int id );
	bool						remove_copy_data_by_id( int id );
	bool						add_copy_data( hy_copy_data* copy_data, bool update_ = false );


	hy_copy_data*				create_copy_data( int player_id, int copy_template_id );
private:
	hy_copy_data_map			m_copy_data_map;
};